﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FaultBackService.Models;

namespace FaultBackService.BLL
{
    class RealTimeFaultData
    {
        DAL.RealTimeFaultData dal = new DAL.RealTimeFaultData();
        /// <summary>
        /// 写入多条记录，返回记录条数
        /// </summary>
        /// <param name="faultDataList"></param>
        /// <returns></returns>
        internal int AddList(IList<Models.RealTimeFaultData> faultDataList)
        {
            return dal.AddList(faultDataList);
        }

        /// <summary>
        /// 获取昨天的数据集合
        /// </summary>
        /// <returns></returns>
        internal IList<Models.RealTimeFaultData> GetListOfYesterday()
        {
            return GetList(DateTime.Today.AddDays(-1));
        }

        /// <summary>
        /// 获取指定日期的数据集合
        /// </summary>
        /// <param name="dateTime"></param>
        /// <returns></returns>
        internal IList<Models.RealTimeFaultData> GetList(DateTime day)
        {
            return dal.GetList(day);
        }
    }
}
